class Solution {
public:
    int lengthOfLIS(vector<int>& nums) {
        int cnt = 0;
        const int m = nums.size();

        vector<int> dp(m, 1);
        int ret = 1;
        int tmp = 0;
        for(int i = 1; i < m; ++i)
        {
            for(int j = i - 1; j >= 0; j--)
            {
                if(nums[i] - nums[j] > 0)
                {
                    dp[i] = max(dp[i], dp[j] + 1);
                    ret = max(dp[i], ret);
                }
            }
        }

        return ret;
    }
};
